﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace XNA_TD.Menue
{
    public class GeldAnzeige : GUI
    {
        private Texture2D texture = null;
        private Vector2 txtpos;
        private SpriteFont font;

        public GeldAnzeige()
        {
            texture = Content.Load<Texture2D>("Menue/geld");
            font = Content.Load<SpriteFont>("debugfont");
            size = new Rectangle(
                graphics.GraphicsDevice.Viewport.Width - texture.Width,
                0,
                texture.Width,
                texture.Height);
            txtpos = new Vector2(
                graphics.GraphicsDevice.Viewport.Width - 20,
                2);
        }

        public override void Resize()
        {
            size.X = graphics.GraphicsDevice.Viewport.Width - texture.Width;
        }

        public override void MouseClick()
        {
            // vieleicht hier eine stats seite einbauen
        }

        public override void Draw()
        {
            txtpos.X = graphics.GraphicsDevice.Viewport.Width - 20 - font.MeasureString(geld.ToString()).X;

            var depthStencilState = graphics.GraphicsDevice.DepthStencilState;
            spriteBatch.Begin();
            spriteBatch.Draw(texture, size, Color.White);
            spriteBatch.DrawString(font, geld.ToString(), txtpos, Color.Black);
            spriteBatch.End();
            graphics.GraphicsDevice.DepthStencilState = depthStencilState;
        }
    }
}
